Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

164
Vistas
window.opener causes error "Uncaught TypeError: Cannot read properties of null (reading 'opener')" if calendar dialog is displayed first

I have a dialog containing a text entry field with a calendar icon that when clicked displays a calendar lookup. Next to that is a button that calls a function to copy the text entry field values to a list of other fields in the dialog. The code is below. If I simply enter a date and hit the Copy button, it works fine. But if I click the calendar icon to select a date from the calendar lookup, the FIRST time I click 'Copy', I get this error:

"Uncaught TypeError: Cannot read properties of null (reading 'opener')"

The SECOND time I click 'Copy', it copies the date to the other fields. Something about clicking the calendar icon first is screwing up opener(). I am not a JS expert so if you have any suggestions, please be explicit with instructions on how to fix it. Thanks in advance for any help!

// DATE TEXT ENTRY FIELD
html += "<tr><td colspan='4'></td><td><input size='18' type='text' id='uphs_samedate'></td>";
// CALENDAR LOOKUP ICON
html += "<td><a style='display:inline;' displaystyle='inline' id='uphs_samedate_img' href='#' title='/Look up a date' onclick=\"sapphire.lookup.date.open('uphs_samedate','','','','MM/dd/yy hh:mm:ss a','S M' );return false;\" tabindex='0'><img title='Lookup a date' border='0' src='WEB-CORE/imageref/flat/16/flat_black_calendar2.svg'></a></td>";
// BUTTON TO COPY DATE FROM TEXT ENTRY FIELD TO OTHER TEXT FIELDS BELOW
html += "<td><button type='button' id='uphs_setdatebutton' onclick='sapphire.ui.dialog.getDialogObject().opener.uphs_colxn_set_copydownvalues("+ dsLength +")'>Copy Down</button></td></tr>";

... [LIST OF TEXT FIELDS TO WHICH TO COPY ABOVE DATE]

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda